
#include <BPainter>
#include "MyWidget.h"

MyWidget::MyWidget(BWidget* parent) : BWidget(parent)
{
	_texture = new MyTexture();
}
MyWidget::~MyWidget()
{

}


void MyWidget::paintEvent(const BPaintEvent& paintEvent)
{
	int width = this->width();
	int height = this->height();

	BPainter painter(this);

	painter.setColor(BColor(0.5, 0.5, 0.5, 0.5));
	painter.fillRect(0, 0, width, height);

	painter.setTexture(_texture);
	painter.fillRect(0, 0, width, height);
	painter.setTexture(0);

	painter.setColor(BColor(0, 1, 0));
	painter.drawRect(0, 0, width, height);
}

